package com.rd.student.ruanjian.class4.lichunquan.kaoshi;

import java.io.*;
import java.util.HashMap;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) throws IOException {
        Scanner sc =new Scanner(System.in);
        File file = new File("D:\\gitclone\\rd2304\\src\\com\\rd\\student\\ruanjian\\class4\\lichunquan\\kaoshi\\player.txt");
        System.out.println(file);
        BufferedReader br = new BufferedReader(new FileReader(file));
        HashMap<String , String > hashMap = new HashMap<>();
        String str = br.readLine();
        while(str != null){
            String[] s = str.split("，");
            hashMap.put(s[0],s[1]);
            str =  br.readLine();
        }
        System.out.println("输入球员名");
        String name = sc.next();
        if(hashMap.containsKey(name)){
            System.out.println(hashMap.get(name));
        }else{
            System.out.println("不存在该球员");
        }

    }
}
class QiuDui{
    String QiuYuan ;
    String QiuDui ;

    QiuDui() throws IOException { }
    @Override
    public String toString() {
        return QiuYuan+","+QiuDui;
    }
}
